home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_02_06
/
tp55.src
< prev
next >
Wrap
Text File
|
1990-11-04
|
53KB
|
2,483 lines
;=============================================================================
;=============================================================================
;
; Macro Library for Turbo Pascal v5.5
;
; Writen by Clark A. Calkins,
; C. C. Software
; 1907 Alvarado Ave.
; Walnut Creek, CA 94596
;
; circa September 1990
;
; This file may be freely copied and used for non-commercial purposes.
; Intended for use with the Masterful Disassembler (MD86) version 2.3 or
; later. This file should be compiled with MD86MAC v1.3 or later. No
; compiler error or warning messages should be generated.
;
; There are no known coding errors in these macros but no guarantees are
; implied.
;
;=============================================================================
;=============================================================================
;
;=============================================================================
; String processing macros.
;=============================================================================
;
; =====>>> String write macros.
;
;
; Macro to write out the first string constant w/o format.
;
macroname = WrtStrCnstF
size = 10
mask = $ff,$00,$00,$ff,$ff,$ff,$00,$00,$ff,$ff,$ff,$ff,$ff,$ff
compare = $bf,$00,$00,$1e,$57,$bf,$00,$00,$0e,$57,$31,$c0,$50,$9a
flags = call
comment = Write first string constant.
;
; Verify call destination.
;
argument
rbyte = 14
type = faraddress
name = WrtItem
endargument
;
; Get address if FCB.
;
argument
rbyte = 1
type = address
segment = ds
endargument
;
; Get address of string constant.
;
argument
rbyte = 6
type = address
segment = cs
endargument
endmacro
;
; Macro to write out a string constant w/o format.
;
macroname = WrtStrCnst
size = 7
mask = $ff,$00,$00,$ff,$ff,$ff,$ff,$ff,$ff
compare = $bf,$00,$00,$0e,$57,$31,$c0,$50,$9a
flags = call
comment = Write string constant.
;
; Verify call destination.
;
argument
rbyte = 9
type = faraddress
name = WrtItem
endargument
;
; Get address of string constant.
;
argument
rbyte = 1
type = address
segment = cs
endargument
endmacro
;
; Macro to write out the first string variable w/o format.
;
macroname = WrtStrVarF
size = 10
mask = $ff,$00,$00,$ff,$ff,$ff,$00,$00,$ff,$ff,$ff,$ff,$ff,$ff
compare = $bf,$00,$00,$1e,$57,$bf,$00,$00,$1e,$57,$31,$c0,$50,$9a
flags = call
comment = Write first string var.
;
; Verify call destination.
;
argument
rbyte = 14
type = faraddress
name = WrtItem
endargument
;
; Get address if FCB.
;
argument
rbyte = 1
type = address
segment = ds
endargument
;
; Get address of string constant.
;
argument
rbyte = 6
type = address
segment = ds
endargument
endmacro
;
; Macro to write out another string variable w/o format.
;
macroname = WrtStrVar
size = 7
mask = $ff,$00,$00,$ff,$ff,$ff,$ff,$ff,$ff
compare = $bf,$00,$00,$1e,$57,$31,$c0,$50,$9a
flags = call
comment = Write string var.
;
; Verify call destination.
;
argument
rbyte = 9
type = faraddress
name = WrtItem
endargument
;
; Get address of string constant.
;
argument
rbyte = 1
type = address
segment = ds
endargument
endmacro
;
; Macro to check the results of previous I/O.
;
macroname = CheckIO_Result
size = 2
mask = $ff,$00,$00,$00,$00,$ff
compare = $9a,$00,$00,$00,$00,$9a
flags = call
argument
rbyte = 1
type = faraddress
name = IO_end
endargument
argument
rbyte = 6
type = faraddress
name = Check_IO
endargument
endmacro
;
; Macro to end a line and check I/O result.
;
macroname = EndLine_CheckIO
size = 2
mask = $ff,$00,$00,$00,$00,$ff
compare = $9a,$00,$00,$00,$00,$9a
flags = call
comment = End line and check IOResult.
argument
rbyte = 1
type = faraddress
name = Line_end
endargument
argument
rbyte = 6
type = faraddress
name = Check_IO
endargument
endmacro
;
; =====>>> Macros for reading in string variables.
;
macroname = ReadLine_CheckIO
size = 2
mask = $ff,$00,$00,$00,$00,$ff
compare = $9a,$00,$00,$00,$00,$9a
flags = call
comment = Read to EOL, check IOResult.
argument
rbyte = 1
type = faraddress
name = Get_EOL
endargument
argument
rbyte = 6
type = faraddress
name = Check_IO
endargument
endmacro
;
; Read a string as the first item in a list.
;
macroname = ReadStrF
size = 9
mask = $ff,$00,$00,$ff,$ff
mask = $ff,$00,$00,$ff,$ff,$ff,$00,$00,$ff,$ff
compare = $bf,$00,$00,$1e,$57
compare = $bf,$00,$00,$1e,$57,$b8,$00,$00,$50,$9a
flags = call,perm
comment = "read str (file, var, len)."
argument
rbyte = 15
type = faraddress
name = RdStrItm
endargument
argument
rbyte = 1
type = address
segment = ds
endargument
argument
rbyte = 6
type = address
segment = ds
endargument
argument
rbyte = 11
type = word
endargument
endmacro
;
; Read the next item as a string.
;
macroname = ReadStr
size = 6
mask = $ff,$00,$00,$ff,$ff,$ff,$00,$00,$ff,$ff
compare = $bf,$00,$00,$1e,$57,$b8,$00,$00,$50,$9a
flags = call,perm
comment = "read string (var, len)."
argument
rbyte = 10
type = faraddress
name = RdStrItm
endargument
argument
rbyte = 1
type = address
segment = ds
endargument
argument
rbyte = 6
type = word
endargument
endmacro
;
;=============================================================================
; =====>>> String assignment and COPY macros.
;=============================================================================
;
;
; Macro to assign a simple string constant to a string variable.
;
; --> StrConstAssign source, destination, max_length
;
macroname = StrConstAssign
size = 9
mask = $ff,$00,$00,$ff,$ff,$ff,$00,$00,$ff,$ff
mask = $ff,$00,$00,$ff,$ff
compare = $bf,$00,$00,$0e,$57,$bf,$00,$00,$1e,$57
compare = $b8,$00,$00,$50,$9a
flags = call,perm
;
; This pseudo argument is used to verify that the call instruction has the
; desired destination address. Its name (StrMove) must already be in place.
;
argument
rbyte = 15
type = faraddress
name = StrMove
endargument
;
; First real argument is the address of the source string constant. This is a
; CS: relative offset too.
;
argument
rbyte = 1
type = address
segment = cs
endargument
;
; Second argument is the address of the destination string variable. This is
; a DS: relative offset (we must declare this or CS {from above} will be
; used).
;
argument
rbyte = 6
type = address
segment = ds
endargument
;
; The last argument is the max length of the destination string. This will
; be used to truncate the string if necessary.
;
argument
rbyte = 11
type = word
endargument
endmacro
;
; Macro to concatinate a string constant to the back of a string variable.
;
; --> ConcatStrConst temp_level,source_str, str_constant
;
macroname = ConcatStrConst
size = 12
mask = $ff,$ff,$ff,$00,$ff,$ff,$ff,$00,$00,$ff,$ff,$ff,$00,$00,$00,$00
compare = $8d,$be,$00,$00,$16,$57,$bf,$00,$00,$1e,$57,$9a,$00,$00,$00,$00
mask = $ff,$00,$00,$ff,$ff,$ff
compare = $bf,$00,$00,$0e,$57,$9a
flags = call,perm
;
; Verify destination address of all calls.
;
argument
rbyte = 12
type = faraddress
name = StrStore
endargument
argument
rbyte = 22
type = faraddress
name = StrAdd
endargument
;
; First argument is the level indicator (which temp variable to use).
;
argument
rbyte = 2
type = word
endargument
;